package com.bailian.spring.servelt.demo.servlet;

import com.bailian.spring.servelt.demo.service.DemoService;
import com.bailian.spring.servelt.demo.service.impl.DemoServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author gaoxu
 * date: Created on 2021/10/28 下午2:39
 */
@WebServlet(urlPatterns = "/demo1")
public class DemoServlet1 extends HttpServlet {

    private DemoService demoService = new DemoServiceImpl();

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //resp.getWriter().println("DemoServlet1 run ......");
        resp.getWriter().println(demoService.findAll());
    }
}
